package com.sykj.cloud.system.api;

import com.sykj.cloud.common.core.constant.ServiceNameConstants;
import com.sykj.cloud.common.core.domain.R;
import com.sykj.cloud.system.api.domain.LogError;
import com.sykj.cloud.system.api.domain.LogUser;
import com.sykj.cloud.system.api.factory.RemoteLogFallbackFactory;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.scheduling.annotation.Async;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

/**
 * @author Mr.will
 * @date 2021/3/30 20:15
 * @Desc 日志服务
 */
@FeignClient(contextId = "remoteLoggerService",value = ServiceNameConstants.LOGGER_SERVICE,fallbackFactory = RemoteLogFallbackFactory.class)
public interface RemoteLoggerService {

    /**
     * 新增用户日志
     */
    @PostMapping("/user")
    R<Boolean> add(@RequestBody LogUser logUser);

    /**
     * 新增错误日志
     */
    @PostMapping("/error")
    @Async
    R<Boolean> add(@RequestBody LogError logError);




}
